package com.briup.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;

public class Test2 {
    public static void main(String[] args) throws Exception {
        // 注册驱动
        Class.forName("com.mysql.cj.jdbc.Driver");
        // 获取连接对象
        String url = "jdbc:mysql://127.0.0.1:3306/briup";
        String username = "root";
        String password = "rootroot";
        Connection conn = DriverManager.getConnection(url,username,password);
        System.out.println("conn = " + conn);

        conn.close();
    }
}
